Folder Control Contents

 Folder Custom Control Contents

The Contents lists Help topics available for the folder custom control.  Use the scroll bar to see entries not currently visible in the Help window.

About Folder Custom Control

Registering

Styles

Compatability

Custom Events

ClickOnTab

GotFrontStatus

LostFrontStatus

Custom Properties

SelectedColour

Bevelwidth

TabHeight

TabLeft

TabOrder

TabRadius

TabUnderline

TabWidth

UnSelectedColour

RoundedCorners

Support Routines

ClickFolderTab

InitialiseFolders


Folder Routines

Function IntialiseFolders( CtrlName As Control ) As Integer

The InitialiseFolders routine automatically assigns a TabOrder to each folder control in a group. A number of folder controls which all share the same container comprises a group. A container for folder controls can be a form, a panel or a frame. The InitialiseFolders routine is called by passing it the name of any one of the folders in the group which is to be initialised. The routine then assigns a TabOrder to each folder, beginning at 1 and incrementing for each folder, on the basis of their current position in the windows z-order list. Thus the top level folder control in the group at design time will receive a TabOrder of one, the next highest, two and so forth.

The function returns a positive integer if it is successful or zero if it fails. The most common reason for failure is the control which is passed as a parameter is not a folder control.

Example

Declare Function InitialiseFolders Lib "folder.vbx" (CtrlName As Control) As Integer

.

.

Sub Main()

Dim initialised As Integer

.

Load Mainform

initialised = InitialiseFolders( Mainform.folder1 )

If initialised Then

   Mainform.Show

End If

Sub ClickFolderTab( CtrlName As Control )

This routine has the exact same effect as clicking on a folder's tab. This may be used when clicking a folder's tab is one of several methods for making a selection and the ClickFolder routine may be called to ensure the folder control positions are consistent with the state of the application.

Example

Declare Sub ClickFolderTab Lib "folder.vbx" (CtrlName As Control)

.

.

ClickFolderTab folder1

.

.


Folder Tab Dimensions

There are four tab properties which determine the dimensions of the tabs. All such

measurements are in twips, and are illustrated in the following diagram.

TabWidth

The width of the tab

TabHeight

The distance from the base of the tab to the top of the tab

TabRadius

The radius of the quadrant which forms the curved corners of the tab. This defaults to half the tab height

TabLeft

The distance from the left of the controls enclosing rectangle that the tab is positioned at.


Folder Tab Colours

SelectedColour

The SelectedColour property identifies the colour of the tab when it is currently selected at run-time ( when it is in front of all other folder controls ), or when its Taborder is set to 1 during design mode.

UnSelectedColour

The UnSelectedColour property identifies the colour of the tab when it is not currently selected at run-time ( when it is behind the currently selected folder control ), or when its Taborder is set to greater than 1 during design mode.

Note:	The folder control does not have a backcolor property as its transparent. Whatever is beneath the folder and not obscured by the tab will be visible


Folder TabOrder

The TabOrder Property is a positive integer which identifies the initial position of the folder at run time, and the colour of the tab, if different selected and unselected colours are used. Setting the TabOrder during design is optional if the InitialiseFolders routine is called in the code. This routine will automatically assign TabOrders. The TabOrder property is used dynamically at run time by the control to keep track of its current position so it is strongly advised not to change this value in the code.


Folder Tab Appearance

The following properties relate to the overall appearance of the folder control and are important in achieving an aesthetically appealing and intuitive style when using groups of folder controls.

A folder with its bevelwidth set to a value of two and its TabUnderline set to False is illustrated below:

Bevelwidth

This property determines the width of the tab's bevel. The default is zero. When this property is set to a non-zero value the control takes on a three dimensional appearance.

TabUnderline

Determines whether or not a line is drawn beneath the tab, delineating it. The purpose of this property is to facilitate different styles of arranging the folders. See Styles

RoundedCorners

This property determines whether the corners of the tab are rounded or straight. This property defaults to True, giving the tab rounded corners. In both cases, the Tabradius property determines the size of the corner portion of the tab.


ClickOnTab Custom Event

The ClickOnTab event occurs when a user clicks on the folder's tab. This event occurs whether or not the folder was positioned at the front, and hence, irrespective of whether the folder changes position as a result of the click. The event is fired after the GotFrontStatus and LostFrontStatus events, and after the control is redrawn, if its position has changed.


LostFrontStatus Custom Event

The LostFrontStatus event occurs for the control which is losing its position as the front control. This event occurs after the GotFrontStatus event for the control which is has been clicked but before the ClickOnTab event and before the controls are redrawn. This event is not fired unless the controls position changes, i.e. it will not be fired by clicking on a folder's tab if the folder is already in the front position.


GotFrontStatus Custom Event

The GotFrontStatus event occurs for the control which is getting the position as the front control. This event occurs before both the LostFrontStatus event for the control which is losing its status as the front control, and the ClickOnTab event for the former. It also occurs before the controls are redrawn. This event is not fired unless the controls position changes, i.e. it will not be fired by clicking on a folder's tab if the folder is already in the front position. This event may be used to perform any initialisation which may be associated with what is presented after the folder tab is clicked, or any custom repositioning of the folders tab.


Styles of Folder Control groups

Folder controls are designed to be used in groups. A number of folder controls which share the same container constitute a group, and as such, react in a co-ordinated fashion to events such as a mouse click or a mnemonic key access. The reaction to a mouse click on the folder's tab is as follows: If the folder is currently in the front position, the mouse click has no visible effect other than to cause a ClickOnTab event. If the control is not currently in the front position, the folder's position and the width of its rectangle is exchanged with the control which currently has the front position, and their positions in the windows z-order list are also exchanged. These features allow several different styles of folder control groups to be created which are both functional and aesthetically appealing.

The following are two examples of how groups of folders may be arranged:

In the above arrangement, the diminishing width of the enclosing rectangles of successive folder controls gives the group a perspective quality. This quality is maintained at run time as the widths of the rectangles are exchanged and the relative position of the folder tab in the rectangle is also maintained when its width changes.

The above arrangement consists of all folder controls having the same position and rectangle sizes. These arrangements also illustrate the use of the TabUnderline and Bevelwidth properties. By setting the Bevelwidth property to non-zero and the TabUnderline property to False in the above arrangement, the selected tab appears to be at the front of the other tabs. In this case, the folders can be used with other three dimensional controls such as frames and panels to create applications where the folder tab appears to be an integral part of the frame or panel. The former arrangement would be suitable as an alternative to, or complementary to a menu.


Registering the Folder Control

This custom control is Shareware. You may freely distribute it to other Visual Basic developers. If, after a evaluationary period of twenty eight days, you decide to continue using it, you should register the control by printing and filling out the registration form, and enclosing a cheque, bank draft or postal order for IR£30.00, Stg£30.00 or US$40.00. This should be sent to the following address.

Robert Mullins,

3, Garville Mews,

Rathgar,

Dublin 6,

Rep. of Ireland.

In return, you will be sent an enhanced version of the folder control which allows the creation of vertical tabs which may be oriented in a left or right direction, and which may also host a bitmap or icon. Any comments or suggestions for improvements would also be welcome.

Disclaimer of Warranty

This folder control is distributed as is. It is the responsibility of the developer who uses the folder control to ensure that it operates correctly and any applications which use it are thoroughly tested with non-critical data before being relied upon. The author can accept no liability for loss of data or any other problems which may arise through use of this control.


Registration Form

To register, print the following form and send it to the given address:

---------------------------------------------------------------------------------------------------------------------

Folder Custom Control Version 1.00

I enclose a cheque / bank draft for _____________ in payment for ______ copies of the Folder custom control.

Name(s)	_________________________________________________________

_________________________________________________________

Company	_________________________________________________________

Address	_________________________________________________________

_________________________________________________________

_________________________________________________________

_________________________________________________________

Comments	_________________________________________________________

_________________________________________________________

_________________________________________________________


Compatability
Compatibility

The folder control is compatible with Visual Basic version 2.0 upwards.